Public Class frmElencoContrattiAttribuiti

    Private listaContratti As New DataSet
    Property lista()
        Get
            Return listaContratti
        End Get
        Set(ByVal value)
            listaContratti = value
        End Set
    End Property

    Private Sub frmElencoContrattiAttribuiti_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        flxGriglia.DataSource = listaContratti
        flxGriglia.DataMember = "TAB"
        flxGriglia.AutoResizeColumns()
    End Sub

    Private Sub flxGriglia_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles flxGriglia.KeyDown
        If e.KeyCode = Keys.Escape Then
            Me.DialogResult = Windows.Forms.DialogResult.No
        End If
    End Sub

    Private Sub flxGriglia_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles flxGriglia.CellFormatting

        If flxGriglia.Columns(e.ColumnIndex).Index = 3 Or flxGriglia.Columns(e.ColumnIndex).Index = 2 Then
            If e IsNot Nothing Then
                If e.Value IsNot Nothing Then
                    e.Value = UCase(MonthName(e.Value))
                    e.FormattingApplied = True
                End If
            End If
        End If
        If flxGriglia.Columns(e.ColumnIndex).Index = 1 Then
            If e IsNot Nothing Then
                If e.Value IsNot Nothing Then
                    e.CellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
                    e.FormattingApplied = True
                End If
            End If
        End If



    End Sub
End Class